// digino.js by Luca De Angelis @ Digino Marketing
// hosted on https://code.google.com/p/digino/
// Internal doc on recommended trackEvent and trackConversion usage: \Shared\LIBRARY\Dev\JS\trackEvent-trackConversion-usage

var digino = digino || {};
digino.ga = {
	// digino.ga.trackEvent( 'category', 'action', 'label' );
	trackEvent : function ( category, action, label ) {
		if (_gaq) _gaq.push(['_trackEvent', category, action, label]);
	},
	// digino.ga.trackConversion(conversion_id, 'conversion_label');
	trackConversion : function ( conversion_id, conversion_label ) {
		var AW_image = new Image(1,1);
		AW_image.src = 'http://www.googleadservices.com/pagead/conversion/' + conversion_id + '/?label=' + conversion_label + ' &guid=ON&script=0';
	},
	// digino.ga.trackPageview( '/page_url' );
	trackPageview : function ( page ) {
		if (_gaq) _gaq.push(['_trackPageview', page]);
	},
	// digino.ga.trafficSource();
	trafficSource : function() {
		var nameEQ = '__utmz' + '=',
			ca = document.cookie.split( ';' );

		for ( var i=0; i < ca.length; i++ ) {
			var c = ca[ i ];
			while ( c.charAt( 0 ) == ' ' ) c = c.substring( 1, c.length );
			if ( c.indexOf( nameEQ ) == 0 ) return c.substring( nameEQ.length, c.length );
		}
		return null;
	}
};